package com.lvan.excelhandle.mapper;

import com.lvan.excelhandle.bean.StudentExcel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Lvan
 */
@Mapper
public interface ExcelMapper {

    /**
     * 新增学生记录
     *
     * @param student studentBean
     */
    @Insert("INSERT INTO student ( stu_no, stu_name, stu_id_card, stu_college, stu_specialty, stu_nation ) " +
            "VALUE" +
            "(#{stuNo},#{stuName},#{stuIdCard},#{stuCollege},#{stuSpecialty},#{stuNation})")
    void addStudent(StudentExcel student);

    /**
     * 查询所有学生信息
     *
     * @return List<StudentExcel>
     */
    @Select("SELECT * FROM student ;")
    List<StudentExcel> searchAllStudentInfo();
}
